package com.dapao.mapper;

import com.dapao.pojo.Good;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GoodMapper {

    List<Good> page(String goodKeyValue, Integer sellerId);

    @Select("select * from `match`.`second_hand` where id = #{id}")
    Good detail(Integer id);

    @Insert("insert into second_hand(good_name,price,seller_id,seller_qq,image,time,good_content)" +
            "values(#{goodName},#{price},#{sellerId},#{sellerQq},#{image},#{time},#{goodContent})")
    void addGood(Good good);

    @Delete("delete from second_hand where id = #{id}")
    void deleteGood(Integer id);
}
